The present invention expands on the notion of a rebroadcast mesh network developed by Nordic Semiconductors and provides the additional features. A rebroadcasting mesh network functions by flooding all messages to all nodes in the mesh network through broadcasts. Each time that a node receives a broadcast message from some other node in the mesh network, the node repeats the message (i.e. rebroadcasts the message) which lets the surrounding neighbor nodes hear the new message. The neighbor nodes rebroadcast the message to their neighbor nodes, and the process is repeated until all nodes in the mesh network have received the message. This allows wireless devices to talk to each other without being within direct radio range, as devices between them help relaying messages.
In many cases, the mesh network is used primarily for routing between a gateway/coordinator (GW) node (or a root node) that is connected to the external world, and a multitude of other intermediate nodes that are connected to the GW node via the mesh network. In such cases, routing between arbitrary nodes within the mesh network is not required. In such cases, a close to optimal routing algorithm is suggested for the present invention, which relies on minimal information transfer between the nodes, but still provides with optimal or close to optimal routing.